package com.zgjkhis.modules.enums;

import lombok.Getter;

@Getter
public enum InfoTypeEnum {
	/**
	 * @Author yzq
	 * @Description 中药处方
	 * @Date 2021/9/14 15:02
	 * @Param
	 * @return
	 **/
	ZYCF(1, "中药处方饮片"),

	/**
	 * @Author yzq
	 * @Description 成药处方
	 * @Date 2021/9/14 15:02
	 * @Param
	 * @return
	 **/
	CYCF(2, "成药处方"),

	/**
	 * @Author yzq
	 * @Description 成药处方
	 * @Date 2021/9/14 15:02
	 * @Param
	 * @return
	 **/
	ZYCFKLJ(3, "中药处方颗粒剂"),

	/**
	 * @Author yzq
	 * @Description 输液处方
	 * @Date 2021/9/14 15:02
	 * @Param
	 * @return
	 **/
	SYCF(4, "输液处方"),

	/**
	 * @Author yzq
	 * @Description 敷贴处方
	 * @Date 2021/9/14 15:02
	 * @Param
	 * @return
	 **/
	FTCF(5, "敷贴处方"),




	;

	private final Integer code;

	private final String value;

	InfoTypeEnum(Integer code, String value) {
		this.code = code;
		this.value = value;
	}

	public static String findByCode(Integer code) {
		for (InfoTypeEnum drugTypeEnum : InfoTypeEnum.values()) {
			if (drugTypeEnum.getCode().equals(code)) {
				return drugTypeEnum.value;
			}
		}
		return "未知";
	}
	public static Integer findByValue(String value) {
		for (InfoTypeEnum drugTypeEnum : InfoTypeEnum.values()) {
			if (drugTypeEnum.getValue().equals(value)) {
				return drugTypeEnum.code;
			}
		}
		return null;
	}

}
